<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@include file="init.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/scrip.js"></script>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Lựa chọn cấu hình phần cứng</title>
</head>
<body>
<div class="master-wrapper-content">
	<jsp:include page="heading.jsp"></jsp:include>
	<jsp:include page="listCategory.jsp"></jsp:include>
	<div class="container-right">	
		<%
			List<Category> categorys = dataManager.getCategorysByParentId(
					dataManager.getCategoryByName("Linh kiện máy tính").getCategoryId());
			int tongtien = 0;
			
		%>
		
		<form action="viewProductSelected" method="post">
			<%
				for(Category category : categorys) {
					List<Producer> producers = dataManager.getProducerWithCategoryId(category.getCategoryId());
					int i;
					
					%>
					<div class="row">
						<div class="name-colum"><%=category.getCategoryName() %></div>
						
						<select class="producer-colum" name="<%="producer " + category.getCategoryName() %>" 
							onchange="getProductWithProducerId('<%=category.getCategoryName() %>', '<%=category.getCategoryId() %>')">
										
						<option value="-1">...</option>
						<%
							for(Producer producer : producers) {
								%>
								<option value="<%=producer.getProducerId() %>"><%=producer.getProducerName() %></option>
								<%
							}
						%>
						</select>
						
						<select class="product-colum" name="<%=category.getCategoryName() %>" disabled="disabled" 
								onchange="getPriceProduct('<%=category.getCategoryName() %>')">
							<option value="-1">.....</option>
							<option value="-2">.....</option>
						</select>
						<div class="gia-colum">
							<span class="gia"  id="<%=category.getCategoryName() %>"></span>
						</div>
						<br />
					</div>
					<%
				}
			%>
			<div class="row">
				<span id="sumprice">0</span> <br /> <br />
			</div>
			<div id="button-row">
				<input type="submit" value="Chấp nhận" />
			</div>
		</form>
	</div>
<div class="clear" ></div>
<jsp:include page="footer.jsp"></jsp:include>
</div>
</body>
</html>